import request from '@/utils/request'

// 获取图书列表
export function getBookList(params) {
  return request({
    url: '/book/list',
    method: 'get',
    params
  })
}

// 添加图书
export function addBook(data) {
  return request({
    url: '/book/add',
    method: 'post',
    data
  })
}

// 更新图书
export function updateBook(data) {
  return request({
    url: '/book/update',
    method: 'put',
    data
  })
}

// 删除图书
export function deleteBook(id) {
  return request({
    url: `/book/${id}`,
    method: 'delete'
  })
}

// 更新图书状态
export function updateBookStatus(id, status) {
  return request({
    url: `/book/${id}/status`,
    method: 'put',
    params: { status }
  })
}

// 批量添加图书
export function batchAddBooks(data) {
  return request({
    url: '/book/batchAdd',
    method: 'post',
    data
  })
} 